package bookpos.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import bookpos.dao.BookDao;
import bookpos.entity.Book;
import bookpos.service.BookService;
import bookpos.vo.BookVO;
/**
 * 客户业务实现类
 * @author WZB
 *
 */
@Service
public class BookServiceImpl implements BookService {
	@Autowired
	private BookDao dao;

	public void saveBook(Book vo) {
		dao.save(vo);
		
	}
	public void updateBook(Book vo) {
		dao.update(vo);
		
	}
	public void deleteBook(int id) {
		Book vo = dao.get(id);
		dao.delete(vo);
	}

	public List<Book> findAllBook(int page, int rows, String sort, String order) {
		return dao.findAll(page, rows, sort, order);
	}

	public int getTotal() {
		return dao.countAll();
	}
//	public boolean isExist(String voNo) {
//		boolean flag = false;
//		String hql="from Book as c where c.BookNo="+customerNo;
//		if (dao.find(hql).size()>0){
//			flag = true;
//		}
//		return flag;
//	}
	@Override
	public List<Book> findAllInventory(int page, int rows, String sort,
			String order) {
		// TODO Auto-generated method stub
		return null;
	}
}
